const express=require('express');
const cookieSession=require('cookie-session');

let server=express();
server.listen(8080);

server.use(cookieSession({
    secret:'sesssssdadas'
}));

server.get('/',(req,res)=>{
    // 访客浏览次数统计

    if(req.session['count']){
        req.session['count']++;
    }else{
        req.session['count']=1;
    }
    console.log(`您是第${req.session['count']}次访问本站了`)
 
    res.end();
})